//
//  BasicMode.m
//  CarTown
//
//  Created by xionghao on 15/8/5.
//  Copyright (c) 2015年 熊浩. All rights reserved.
//

#import "BasicMode.h"

@implementation BasicMode
-(void)setIsmultlesLines:(BOOL)ismultlesLines{
    _ismultlesLines=ismultlesLines;
    if (_ismultlesLines) {
        
        CGFloat textwith=XHScreenwidth==320?235:308;
        NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc]init];
        paragraphStyle.lineBreakMode = NSLineBreakByWordWrapping;
        NSDictionary *attribute = @{NSFontAttributeName: [UIFont systemFontOfSize:13],NSParagraphStyleAttributeName:paragraphStyle.copy};
        
        CGSize labelSize = [self.detail boundingRectWithSize:CGSizeMake(textwith, 0) options: NSStringDrawingUsesLineFragmentOrigin  attributes:attribute context:nil].size;
        
        if (labelSize.height+24<44) {
            self.rowheight=44;
        }else{
            self.rowheight=labelSize.height+36;
        }
    }
}
@end
